import { _decorator, Layout, Prefab } from "cc";
import { JCComponent } from "../JCComponent";
import { PokerCard } from "./PokerCard";

const { ccclass, property } = _decorator;

@ccclass('HandCardPanel')
export class HandCardPanel extends JCComponent {

    @property(Layout)
    layout: Layout = null


    @property(Prefab)
    cardPrefab: Prefab = null


    clearCards(){
        this.layout.node.removeAllChildren()
    }
   

    getSelectedCards() {
        return this.layout.node.children.filter(i => i.getComponent(PokerCard).isSelected).map(i => i.getComponent(PokerCard))
    }

    start() {

    }

    update(deltaTime: number) {

    }
}

